package top.yxqz.spring.ioc.pojo;

/**
 * @author: 余小小
 * @date: 2023/4/7
 * @description：
 */
public class User {
    private String useName;
    private String gender;
    private Integer age;

    public User() {
        System.out.println("1.对象实例化");
    }

    public User(String useName, String gender, Integer age) {
        this.useName = useName;
        this.gender = gender;
        this.age = age;
    }

    /**
     * 获取
     *
     * @return useName
     */
    public String getUseName() {
        return useName;
    }

    /**
     * 设置
     *
     * @param useName
     */
    public void setUseName(String useName) {
        System.out.println("2.DI了数据");
        this.useName = useName;
    }

    /**
     * 获取
     *
     * @return gender
     */
    public String getGender() {
        return gender;
    }

    /**
     * 设置
     *
     * @param gender
     */
    public void setGender(String gender) {
        this.gender = gender;
    }

    /**
     * 获取
     *
     * @return age
     */
    public Integer getAge() {
        return age;
    }

    /**
     * 设置
     *
     * @param age
     */
    public void setAge(Integer age) {
        this.age = age;
    }

    public String toString() {
        return "User{useName = " + useName + ", gender = " + gender + ", age = " + age + "}";
    }


    /**
     * 初始化方法
     */
    public void initMethod() {
        System.out.println("3.Bean初始化了");
    }

    /**
     * 销毁的方法
     */
    public void destoryMethod() {
        System.out.println("4.Bean[销毁]了");

    }

}
